#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <wchar.h>

/// <summary>
/// TODO
/// </summary>
int FILEExists(const char* path)
{
	int handle = -1;
	if ((handle = open(path, O_RDONLY)) < 0)
		return -1;
	close(handle);
	return 0;
}

/// <summary>
/// TODO
/// </summary>
int FILEOpen(const wchar_t* path, int flags)
{
	char file[1024];
	if (wcstombs(file, path, 1024) <= 0)
		return -1;
	return open(file, flags);
}

